<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title><?php echo ViewUtil::retrieveCopLabel(); ?></title>
		
		<!-- JQuery -->
	    <script type="text/javascript" src="../../js/jquery/jquery.js"></script>
	    <script type="text/javascript" src="../../js/jquery/iutil.js"></script>
	 	<script type="text/javascript" src="../../js/jquery/jquery.interface.js"></script>
	    <script type="text/javascript" src="../../js/jquery/jquery.autocomplete.js"></script>
	    <script type="text/javascript" src="../../js/jquery/jquery.json.js"></script>
	    <script type="text/javascript" src="../../js/jquery/jquery.thickbox.js"></script>
	    <!-- End of JQuery -->
	    
	    
	    <?php if (USE_XBROWSER_DEBUGGER): ?>
	    <!-- Firebug lite -->
	    <script type="text/javascript" src="../../js/debug/pi.js"></script>
	    <script type="text/javascript" src="../../js/debug/firebug-lite.js"></script>
	    <!-- End of firebug lite -->
	    <?php endif; ?>
	    
	    <!-- Style sheets -->
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/autocomplete.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/thickbox.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/common.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/widget.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/wall.css" />
	    <?php include dirname(__FILE__) . "/../${GLOBALS['dir_theme']}partials/x-browser.tpl"; ?>
	    <!-- End of Stylesheets -->
	    
	    <!-- JavaScript Widget Engine -->
	    <script type="text/javascript" src="../../js/portal/I18n.js"></script>
	    <script type="text/javascript" src="../../js/portal/engine.js"></script>
	    <script type="text/javascript" src="../../js/portal/EventDispatcher.js"></script>
	    <script type="text/javascript" src="../../js/portal/Widget.js"></script>
	    <script type="text/javascript" src="../../js/portal/WidgetContainer.js"></script>
	    <script type="text/javascript" src="../../js/portal/ConfigParser.js"></script>
	    <script type="text/javascript" src="../../js/portal/WidgetFactory.js"></script>
	    <script type="text/javascript" src="../../js/portal/debug.js"></script>
	    <script type="text/javascript" src="../../js/portal/utils.js"></script>
		<script type="text/javascript" src="../../js/portal/DragManager.js"></script>
		<script type="text/javascript" src="../../js/portal/WidgetDragStub.js"></script>
		<script type="text/javascript" src="../../js/portal/WidgetSeeker.js"></script>
		<!-- End of JavaScript Widget Engine -->
	
		<script type="text/javascript">
		$(document).ready(function(){
		
			<?php echo 'window.portalBaseURI = "' . BASE_PORTAL_URI .'";'; ?>
		
			initWidgetSearch();
		
			dragManager.initialize ("ghost", "mask", true);
	
			/* load user interface */		
			loadInterface();
			
			// Initiate Drag & Drop Support
			$('#columns td').Sortable(
				{
					accept: 'widget_container',
					helperclass: 'sort_placeholder',
					opacity: 0.1,
					ghosting: false,
					tolerance: 'intersect',
					handle: 'div.widget_title_container',
					onchange: function(i) {
						updateInterface(i, 'move');
					}
				}
			);
		});
		</script>
	</head>

	<body>
	<div id="mask"></div>
		<div id="header">
			<?php if ($copName = ViewUtil::retrieveCopName()): ?>
			<div id="organization_name"><?php echo $copName; ?></div>
			<?php endif; ?>
			<img id="logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/logo.png"/>
			<a id="header_action" <?php if (!$useServiceBrowser): ?>class="thickbox"<?php endif; ?> title="<?php echo __("Add widgets"); ?>" href="<?php echo (!$useServiceBrowser) ? ('#TB_inline?width=660&inlineId=widget_search_content&closeCaption=' . __("Close")) : $serviceBrowserURI; ?>"><?php echo __("Add widgets"); ?></a>
			<div id="control">
				<ul id="user_info">
					<li><?php echo Auth::getUserName();?></li>
				</ul>
				
				<ul>
					<?php if ($widgetManagement) : ?>
					<li><a id="administration" href="../../index.php/admin/index"><?php echo __("Administration"); ?></a></li>
					<?php endif; ?>
					<li><a id="preferences" href="../../index.php/users/preferences"><?php echo __("My preferences"); ?></a></li>
					<li><a id="help" href="../../index.php/help/index"><?php echo __("Online help"); ?></a></li>
				</ul>
				
				<ul>
					<li><a id="logout" href="../../index.php/users/logout"><?php echo __('Logout'); ?></a></li>
				</ul>
			</div>
		</div>
		<div id="content">
			<table id="columns" border="1">
				<tr>
					<td id="c_0" class="column first"></td>
					<td id="c_1" class="column"></td>
					<td id="c_2" class="column"></td>
				</tr>
			</table>
		</div>
		
		<div id="debugWindow"></div>
		<div id="ghost"></div>
		
		<div id="widget_search_content">
			<div id="widget_search">
				<div class="info"><?php echo __("Click on a widget to add it to your widget wall."); ?></div>
				<div id="categories">
					<h2><?php echo __("Categories"); ?></h2>
					<ul></ul>
				</div>
				
				<div id="results">
					<ul></ul>
					<div id="navigator"><a id="previous_widgets" href="#"><?php echo __("Previous"); ?></a><a id="next_widgets" href="#"><?php echo __("Next"); ?></a></div>
				</div>
			</div>
		</div>
		
		<div id="footer">
			<a href="http://europa.eu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-eu.png" alt="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>" title="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>"/></a>
			<a href="http://www.tudor.lu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-tudor.png" alt="<?php echo __("Public Research Center Henri Tudor"); ?>" title="<?php echo __("Centre de Recherche Public Henri Tudor"); ?>"/></a>
			<p>
				<?php echo __("Copyright 2007-2008 Public Research Center Henri Tudor."); ?>
			</p>
		</div>
	</body>
</html>